﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package com.yy.ui.controls {
    import flash.display.*;
    import flash.geom.*;
    import com.fminutes.vinciUI.core.*;

    public class ProgressBar extends UIComponent {

        private var _content:DisplayObject;
        private var contentRect:Rectangle;
        private var maskSprite:Sprite;
        private var offSet:Number;
        private var _w:Number;
        private var _h:Number;

        public function setContentSkin(_arg1:DisplayObject, _arg2:Rectangle):void{
            this.contentRect = _arg2;
            if (((this.content) && (this.contains(this.content)))){
                this.removeChild(this.content);
            };
            this.content = _arg1;
        }
        private function get content():DisplayObject{
            return (this._content);
        }
        private function set content(_arg1:DisplayObject):void{
            this._content = _arg1;
            this._content.x = this.contentRect.x;
            this._content.y = this.contentRect.y;
            this.maskSprite = new Sprite();
            this.maskSprite.graphics.beginFill(0, 0);
            this.maskSprite.graphics.drawRect(0, 0, this.contentRect.width, this.contentRect.height);
            this.maskSprite.graphics.endFill();
            this.maskSprite.x = this.contentRect.x;
            this.maskSprite.y = this.contentRect.y;
            this.maskSprite.width = this.contentRect.width;
            this.maskSprite.height = this.contentRect.height;
            addChild(this.maskSprite);
            addChild(this._content);
            this._content.mask = this.maskSprite;
            this.updateUI();
        }
        public function setProgress(_arg1:Number):void{
            if (this.maskSprite){
                this.maskSprite.width = (this.contentRect.width * _arg1);
                this.maskSprite.x = this.contentRect.x;
                this.maskSprite.y = this.contentRect.y;
            };
            this.updateUI();
        }
        override public function set width(_arg1:Number):void{
            this._w = _arg1;
            this.updateUI();
        }
        override public function get width():Number{
            return (this._w);
        }
        override public function set height(_arg1:Number):void{
            this._h = _arg1;
            this.updateUI();
        }
        override public function get height():Number{
            return (this._h);
        }
        override public function updateUI():void{
        }

    }
}//package com.fminutes.vinciUI.controls 
